package com.yangchuang.openpicture.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yangchuang.openpicture.pojo.Picture;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PictureMapper extends BaseMapper<Picture> {

    //删除 删除了就找不回来了
    void batchDeleteByUrls(@Param("publicUrls") List<String> publicUrls);

    //设为私密
    void batchHideByUrls(@Param("publicUrls") List<String> publicUrls);

    //重新开放
    void batchOpenByUrls(@Param("publicUrls") List<String> publicUrls);


    @Select("select  user_id from picture where id=#{pictureid}")
    Long getPictureOwnerIDByPictureID(@Param("pictureid") Long pictureID);
}